FROM alpine:3.8

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories

# ARG DOCKER_IMAGE_TAG
# ENV EXE_VERSION=$DOCKER_IMAGE_TAG

# wget https://ghproxy.com/https://github.com/grafana/loki/releases/download/v2.0.0/promtail-linux-amd64.gz

# https://wiki.alpinelinux.org/wiki/Running_glibc_programs
# https://pkgs.alpinelinux.org/packages?name=gcompat&branch=v3.8&repo=&arch=&maintainer=
RUN set -eux; \
	apk add --no-cache \
		gcompat \
	; \
	mkdir -p /etc/promtail \
	;

ADD promtail-linux-amd64        /root/promtail
ADD promtail-docker-config.yaml /etc/promtail/config.yml
ADD run.sh                      /root/run.sh

WORKDIR /root

CMD ["/bin/sh", "-c", "/root/run.sh"]
